package com.juyu.miliao.api.controller.whitepacket;

import com.juyu.miliao.api.domain.User;
import com.juyu.miliao.api.domain.vo.VideoWhiteUserVo;
import com.juyu.miliao.api.service.whitepacket.DonkeyFriendService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 推荐驴友的控制器
 * @Auther: 卜加超
 * @Date: 2019/2/13 11:29
 * @Description:
 */
@RestController
@RequestMapping("/donkeyFriend")
public class DonkeyFriendController {
    @Resource
    private DonkeyFriendService donkeyFriendService;
    /**
     * 获取发现列表
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/list/{type}/{page}-{pageSize}")
    public List<VideoWhiteUserVo> getDonkeyFriendList(@PathVariable("page") Integer page,
                                                      @PathVariable("pageSize") Integer pageSize,
                                                      @PathVariable("type") String type){
        if (page <= 0) {
            page = 1;
        }
        if (pageSize <= 0) {
            pageSize = 20;
        }
        return donkeyFriendService.getListByUserId(type,page,pageSize);
    }

}
